<?php

namespace TableTennis\TeamBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;

class DefaultController extends Controller
{

    public function indexAction()
    {
        $teams_list = $this->getDoctrine()
                     ->getRepository('TableTennisTeamBundle:Team')
                     ->getTeams()
                     ->getArrayResult();

        /* Breadcrumbs */
        $breadcrumbs = $this->get("white_october_breadcrumbs");
        $breadcrumbs->addItem("Accueil", $this->get("router")->generate("_homepage"));
        $breadcrumbs->addItem("Liste des équipes du club");
        
        return $this->render('TableTennisTeamBundle:Default:index.html.twig', array( 'teams_list' => $teams_list ));
    }
}